﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>6.页面重定向 </title>
    <script type="text/javascript" src="../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../Content/highlighter/styles/shCoreDefault.css"/>
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>页面重定向</h3>
    <p>
        与Success()和Error()两个函数的使用类似
        我们可以在控制器中直接调用.如下:
    </p>
    <pre class="brush: csharp;">
        if(isLogin)
        {
            this.Redirect("/App/AdminController/Index.htm");
        }
        else
        {
            this.Redirect("/App/UserController/Login.htm");
        }
    </pre>
    <p>
        对应的模板位于Views/Default/Common/Public/下
        分别是Index.aspx和Login.aspx,用户可以重新修改其样式.
    </p>
</body>
</html>
